<template>
  <div class="example">
    <div class="part">
      <div class="title">
        <span class="number">1</span>
        <span class="name titleName">{{$t('CBIAPI.pageTitle.Financing.title')}}</span>
      </div>
      <!--<div class="cont">Receive attachment URL API is used to service order.</div>-->
    </div>
    <div class="part">
      <div class="title">
        <span class="number">1.1</span>
        <span class="name">{{$t('CBIAPI.pageTitle.Financing.title1')}}</span>
      </div>
      <div class="title2" >
        <span class="number">1.1.1</span>
        <span class="name">{{$t('CBIAPI.Request')}}</span>
      </div>
      <div class="table1">
        <el-table
          :data="tableData1"
          border>
          <el-table-column
            prop="Paramter"
            :label="$t('CBIAPI.table.column1')"
            width="180">
          </el-table-column>
          <el-table-column
            prop="ParamerName"
            :label="$t('CBIAPI.table.column2')"
            width="260">
          </el-table-column>
          <el-table-column
            prop="DateType"
            :label="$t('CBIAPI.table.column3')"
            width="180">
          </el-table-column>
          <el-table-column
            prop="MandatoryOptional"
            :label="$t('CBIAPI.table.column4')"
            width="260">
          </el-table-column>
          <el-table-column
            prop="Note"
            :label="$t('CBIAPI.table.column5')"
            width="260">
          </el-table-column>
        </el-table>
      </div>
      <div class="title2" >
        <span class="number">1.1.2</span>
        <span class="name">{{$t('CBIAPI.Response')}}</span>
      </div>
      <div class="table1">
        <el-table
          :data="tableData2"
          border>
          <el-table-column
            prop="Parameter"
            :label="$t('CBIAPI.table.column1')"
            width="245">
          </el-table-column>
          <el-table-column
            prop="ParameterName"
            :label="$t('CBIAPI.table.column2')"
            width="325">
          </el-table-column>
          <el-table-column
            prop="DateType"
            :label="$t('CBIAPI.table.column3')"
            width="245">
          </el-table-column>
          <el-table-column
            prop="Note"
            :label="$t('CBIAPI.table.column5')"
            width="325">
          </el-table-column>
        </el-table>
      </div>
      <div class="title2" >
        <span class="number">1.1.3</span>
        <span class="name">{{$t('CBIAPI.SampleRequest')}}</span>
      </div>
      <div class="json">
        <div>
          <div class="title">Post: Request URL</div>
          <!--<span></span>-->
          <!--<span class="url">{{RequestData.url}}</span>-->
        </div>
        <div>
          <!--<div class="title">Company Profile:</div>-->
          <span>Content-Type: application/Json</span>
          <pre>{{ResponseData.json}}</pre>
        </div>
        <!--<div>-->
        <!--<div class="title">Shareholder Information:</div>-->
        <!--<span>Content-Type: application/Json</span>-->
        <!--<pre>{{ResponseData.json3}}</pre>-->
        <!--</div>-->
        <!--<div>-->
        <!--<div class="title">Listed Information:</div>-->
        <!--<span>Content-Type: application/Json</span>-->
        <!--<pre>{{ResponseData.json5}}</pre>-->
        <!--</div>-->
      </div>
      <div class="title2" >
        <span class="number">1.1.4</span>
        <span class="name">{{$t('CBIAPI.SampleResponse')}}</span>
        <span style="display: block">{{$t('CBIAPI.ResponseJSON')}}</span>
      </div>
      <div class="json">
        <div>
          <!--<div class="title">Company Profile:</div>-->
          <span>Content-Type: application/Json</span>
          <pre>{{ResponseData.json2}}</pre>
        </div>
        <!--<div>-->
        <!--<div class="title">Shareholder Information:</div>-->
        <!--<span>Content-Type: application/Json</span>-->
        <!--<pre>{{ResponseData.json4}}</pre>-->
        <!--</div>-->
        <!--<div>-->
        <!--<div class="title">Listed Information:</div>-->
        <!--<span>Content-Type: application/Json</span>-->
        <!--<pre>{{ResponseData.json6}}</pre>-->
        <!--</div>-->
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "Example",
    data() {
      return {
        tableData1: [{
          Paramter: 'customerNo',
          ParamerName: 'Customer ID',
          DateType: 'String',
          MandatoryOptional: 'Required',
          Note: ''
        }, {
          Paramter: 'columnList',
          ParamerName: 'Field name for information',
          DateType: 'String[]',
          MandatoryOptional: 'Required',
          Note: ''
        }, {
          Paramter: 'pageNo',
          ParamerName: 'Page number',
          DateType: 'Int',
          MandatoryOptional: 'Required',
          Note: ''
        }, {
          Paramter: 'pageSize',
          ParamerName: 'Number of bars per page',
          DateType: 'Int',
          MandatoryOptional: 'Required',
          Note: ''
        }],
        tableData2: [{
          Parameter: 'status',
          ParameterName: 'State code',
          DateType: 'Int',
          Note: '200'
        }, {
          Parameter: 'msg ',
          ParameterName: 'Query success and failure information',
          DateType: 'String',
          Note: 'Success/ failure message'
        }, {
          Parameter: 'data',
          ParameterName: 'Query result',
          DateType: 'Json',
          Note: 'total:Total number of query results;data:Query detail data;pageNo:Page number;totalPageNo:PageCount'
        }, {
          Parameter: 'success',
          ParameterName: 'Is the query successful',
          DateType: 'Boolean',
          Note: 'True/false'
        }],
        tableData3: [{
          FieldName: 'Customer ID',
          FieldDefinition: 'customerNo',
          FieldType: 'String',
          Required: 'Required',
          Comments: 'Not empty, must be transmitted'
        }, {
          FieldName: 'Field name for information',
          FieldDefinition: 'columnList ',
          FieldType: 'String[]',
          Required: 'Required',
          Comments: 'Not empty, must be transmitted '
        }],
        tableData4: [{
          FieldName: 'Customer ID',
          FieldDefinition: 'customerNo',
          FieldType: '',
          Required: '',
          Comments: ''
        }, {
          FieldName: 'Field name for information',
          FieldDefinition: 'columnList ',
          FieldType: '',
          Required: '',
          Comments: ''
        },
          {
            FieldName: 'Page number',
            FieldDefinition: 'pageNo ',
            FieldType: '',
            Required: '',
            Comments: ''
          },
          {
            FieldName: 'Number of bars per page',
            FieldDefinition: 'pageSize',
            FieldType: '',
            Required: '',
            Comments: ''
          }
        ],
        RequestData: {
          url: 'https://soa-test.lenovo.com/api/dcg/v1.0.0/getCreditInfo',
          url3: 'https://soa-test.lenovo.com/api/dcg/v1.0.0/getCreditInfo',
        },
        ResponseData: {
          json: {"customerNo":"206851458",
            "columnList":["cus_id","num","time","rotation","valuation","amount","ratio","investor"],
            "pageNo":1,
            "pageSize":5
          },
          json3: {
            "customerNo": "206851458",
            "columnList": [
              "big_holder",
              "investment_rate",
              "subscribed_capital"
            ]
          },
          json2: {
            "status": 200,
            "msg": "success",
            "data": {
              "total": 1,
              "data": [
                {
                  "cusId": "206851458",
                  "num": "1",
                  "time": "2010-06-23",
                  "rotation": "IPO上市",
                  "valuation": "-",
                  "amount": "5.72亿人民币",
                  "ratio": "-",
                  "investor": "公开发行"
                }
              ],
              "pageNo": 1,
              "pageSize": 5,
              "totalPageNo": 1
            },
            "success": true
          },
          json4: {
            "status": 200,
            "msg": "success",
            "data": {
              "total": 1,
              "data": [
                {
                  "bigHolder": "香港易成集团有限公司",
                  "investmentRate": "87.96%",
                  "subscribedCapital": "42727.215600万人民币"
                }
              ]
            },
            "success": true
          },
          json5: {
            "customerNo": "206851458",
            "columnList": [
              "security_sort",
              "stock_code_a",
              "stock_intro_a",
              "stock_code_b",
              "stock_intro_b",
              "stock_code_h",
              "stock_intro_h",
              "listed_exchange",
              "the_csrc_ndustry"
            ]
          },
          json6: {
            "status": 200,
            "msg": "success",
            "data": {
              "total": 1,
              "data": [
                {
                  "securitySort": "深交所中小板A股",
                  "stockCodeA": "002438",
                  "stockIntroA": "江苏神通",
                  "stockCodeB": "--",
                  "stockIntroB": "--",
                  "stockCodeH": "--",
                  "stockIntroH": "--",
                  "listedExchange": "深圳证券交易所",
                  "theCsrcNdustry": "制造业-通用设备制造业"
                }
              ]
            },
            "success": true
          },
          json7: {
            "customerNo": "206851458",
            "columnList": ["cus_id", "num", "time", "rotation", "valuation", "amount", "ratio", "investor"],
            "pageNo": 1,
            "pageSize": 5
          },
          json8: {
            "status": 200,
            "msg": "success",
            "data": {
              "total": 1,
              "data": [
                {
                  "cusId": "206851458",
                  "num": "1",
                  "time": "2010-06-23",
                  "rotation": "IPO上市",
                  "valuation": "-",
                  "amount": "5.72亿人民币",
                  "ratio": "-",
                  "investor": "公开发行"
                }
              ],
              "pageNo": 1,
              "pageSize": 5,
              "totalPageNo": 1
            },
            "success": true
          },
          json9: {
            "customerNo": "206851458",
            "columnList": [
              "year",
              "total_assets",
              "total_equity",
              "total_salesquity",
              "gross_revenue",
              "main_composition",
              "total_sales",
              "net_profit_of_company_shareholder",
              "income_proportion",
              "main_cost",
              "cost_proportion",
              "net_profit_ratio",
              "main_profit",
              "profit_proportion",
              "gross_profit_rate"
            ]
          },
          json10: {
            "status": 200,
            "msg": "success",
            "data": {
              "total": 1,
              "data": [
                {
                  "year": "2017",
                  "totalAssets": "",
                  "totalEquity": "",
                  "totalSalesquity": "",
                  "grossRevenue": "755661421.21",
                  "mainComposition": "冶金行业",
                  "totalSales": "",
                  "netProfitOfCompanyShareholder": "62399567.82",
                  "incomeProportion": "31.54%",
                  "mainCost": "1.47亿",
                  "costProportion": "30.74%",
                  "netProfitRatio": "62399567.82",
                  "mainProfit": "9100.42万",
                  "profitProportion": "32.93%",
                  "grossProfitRate": "38.18%"
                }
              ]
            },
            "success": true
          },
          json11: {
            "customerNo": "207040913",
            "columnList": ["branch_name", "legal_person", "state", "registered_capital"]
          },
          json12: {
            "status": 200,
            "msg": "success",
            "data": {
              "total": 2,
              "data": [
                {
                  "branchName": "三峡金沙江川云水电开发有限公司永善溪洛渡电厂",
                  "legalPerson": "谢峰",
                  "state": "正常",
                  "registeredCapital": "3400000万元(万人民币)"
                },
                {
                  "branchName": "三峡金沙江川云水电开发有限公司宜宾向家坝电厂",
                  "legalPerson": "谢峰",
                  "state": "正常",
                  "registeredCapital": "3400000万元(万人民币)"
                }
              ]
            },
            "success": true
          }


        },
        jsonRequest: {
          type: 'POST',
          url: 'https://soa-test.lenovo.com/t1/api/pc_activition/v1.0/api/getMtmSbomData HTTP/1.1',
          contentType: 'application/json',
          data: {
            "appKey": "cbi_public_certification",
            "secret": "85699AC56E0A7D6730849FC1563EE0C7",
            "_timestamp": "1532423927890",
            "sign": "A87F84874C3329580672419CC5D391A9",
            "prod_machine_type": "6173",
            "warranty_start_month": "201611",
            "page": "1"
          }
        },
        jsonResponse: {
          data: {
            "status": 200,
            "msg": "success",
            "data": {
              "total": 126,
              "page": 1,
              "data": [
                {
                  "wty_coverage_start_date": "20161102",
                  "prod_build_date": "20161031",
                  "prod_ship_date": "20161101",
                  "prod_series": "77X2SHT",
                  "source": "ibase",
                  "sold_to_name": "ALSO Schweiz AG",
                  "ship_to_name": "ALSO SCHWEIZ AG",
                  "wty_coverage_end_date": "20191216",
                  "prod_material": "61732UL",
                  "ship_to_id": "1213063824",
                  "prod_activation_flag": "",
                  "prod_activation_date": "",
                  "prod_brand_name": "STORAGE",
                  "sales_geography": "EMEA",
                  "sales_market": "SWITZERLAND",
                  "prod_subser_name": "Storage Tape Products",
                  "prod_machine_type": "6173",
                  "ship_to_country": "CH",
                  "prod_activation_country": "",
                  "prod_activation_source": "",
                  "prod_material_desc": "Storage TS3100 TapeLibraryModel L2U",
                  "prod_bh_series": "OPTION",
                  "qty": 1,
                  "prod_series_name": "Tape Series",
                  "sales_territory": "DACH",
                  "sold_to_id": "1213063824"
                },
              ]
            }
          }
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
  @import "./css/index";
</style>
